# Maintainer: Antonio Rojas <arojas@archlinux.com>

_pyname=jupyter_server_fileid
pkgname=jupyter-server-fileid
pkgver=0.8.0
pkgrel=2
pkgdesc='A Jupyter Server extension providing an implementation of the File ID service'
arch=(any)
url='https://jupyter.org/'
license=(BSD)
depends=(jupyter-server)
makedepends=(python-build python-installer python-hatchling)
checkdepends=(python-pytest-jupyter)
source=(https://pypi.python.org/packages/source/j/$_pyname/$_pyname-$pkgver.tar.gz)
sha256sums=('1e0816d0857f490fadea11348570f0cba03f70f315c9842225aecfa45882b6af')

build() {
  cd $_pyname-$pkgver
  python -m build --wheel --no-isolation
}

check() {
  cd $_pyname-$pkgver
# https://github.com/jupyter-server/jupyter_server_fileid/issues/58
  pytest -v -k 'not test_get_path_oob_move_nested and not test_get_path_oob_move_deeply_nested'
}

package() {
  cd $_pyname-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname
  mv "$pkgdir"/{usr/,}etc
}
